package com.example.demo1.itlianxi07;

/**
 * 1.使用类的class属性来获取该类对应的Class对象。
 * 2.调用对象的getClass0方法，
 * 3.使用Class类中的静态方法orName(String className),
 */
public class ReflectDemo {
    public static void main(String[] args) throws ClassNotFoundException {

        Class<Student> c1 = Student.class;
        System.out.println(c1);

        System.out.println("=============");

        Student s = new Student();
        Class<? extends Student> c2 = s.getClass();
        System.out.println(c2);

        System.out.println("=============");

        Class<?> c3 = Class.forName("com.example.demo1.itlianxi07.Student");
        System.out.println(c3);
    }
}
